package final2107.day06;

public class T3 {
    public synchronized void demo(){
        System.out.println(Thread.currentThread().getName()+"开始demo方法");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(Thread.currentThread().getName()+"结束demo");
    }
    public void test(){
        System.out.println(Thread.currentThread().getName()+"开始test方法");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(Thread.currentThread().getName()+"结束test");
    }
}
